Line data Source code
1 : #pragma once
2 : #include "Direction.hpp"
3 :
4 : class IDriveMotor;
5 :
6 : class NavigationController {
7 : public:
8 : explicit NavigationController(IDriveMotor& motor);
9 :
10 : void moveForward();
11 : void moveBackward();
12 : void stop();
13 : void turn(Direction direction);
14 : void rotateRight();
15 : void rotateLeft();
16 : private:
17 : enum class MotorState {
18 : STOPPED, FORWARD, BACKWARD, LEFT, RIGHT, ROTATING_RIGHT, ROTATING_LEFT
19 : };
20 :
21 : IDriveMotor& motor_;
22 39 : MotorState motorState_ = MotorState::STOPPED;
23 : };
|